#include<stdio.h>
int main()
{
	int T;
	scanf("%d",&T);
	for(int a=0;a<T;a++)
	{
		int sum=0,i,N;
		scanf("%d",&N);
		int x[N+1];
		x[0]=0;
		for(i=1;i<N+1;i++)
		scanf("%d",&x[i]);
		for(i=0;i<N;i++)
		{   
		    if(x[i]<x[i+1])
			sum+=(6*(x[i+1]-x[i]));
			else 
			sum+=(4*(x[i]-x[i+1]));
		}
	sum=sum+5*N;
	printf("%d",sum);
	printf("\n");
	}
	return 0;
}
